var curIndex = -1;
var time = 800;
var slideTime = 5000;
var adTxt = $("#banner_img>li>div>.ad_txt");
var adImg = $("#banner_img>li>div>.ad_img");
autoSlide();
var int = setInterval("autoSlide()", slideTime);
// $("#banner_ctr>ul>li[class!='first-item'][class!='last-item']").click(function () {
    // show($(this).index("#banner_ctr>ul>li[class!='first-item'][class!='last-item']"));
    // window.clearInterval(int);
    // int = setInterval("autoSlide()", slideTime);
// });
function autoSlide() {
    curIndex + 1 >= $("#banner_img>li").size() ? curIndex = -1 : false;
    show(curIndex + 1);
}
function show(index) {
    // $.easing.def = "easeOutQuad";
    // $("#drag_ctr,#drag_arrow").stop(false, true).animate({ left: index * 112 + 40 }, 300);
    $("#banner_img>li").eq(curIndex).stop(false, true).fadeOut(time);
    adTxt.eq(curIndex).stop(false, true).animate({ left: "1020px" }, time,function(){$(this).css("left","-100px");});
    adImg.eq(curIndex).stop(false, true).animate({ left: "-300px" }, time,function(){$(this).css("left","350px");});
    setTimeout(function () {
        $("#banner_img>li").eq(index).stop(false, true).fadeIn(time);
        adTxt.eq(index).children("p").css({ paddingTop: "30px", paddingBottom: "30px" }).stop(false, true).animate({ paddingTop: "0", paddingBottom: "0" }, time);
        adTxt.eq(index).css({ opacity: "0"}).attr( "z-index","10000").stop(false, true).animate({ left: "30px", opacity: "1" }, time);
        adImg.eq(index).css({ right: "-50px", opacity: "0" }).stop(false, true).animate({ left: "5px", opacity: "1" }, time);
    }, 200);
    curIndex = index;
}